/// \file Renderer.h
/// \date 2012-12-05
/// \brief abstract class that offers the rendering and graphics device related functionality

#ifndef _SNAKE_RENDER_RENDERER_H__
#define _SNAKE_RENDER_RENDERER_H__

#include <Model/Include/Scene.h>
#include <vector>
#include <string>

#include <Render/Include/RenderObject.h>

namespace Render
{
/// \brief abstract class that offers the rendering and graphics device related functionality
/// \details it is intended to be specialized in different platforms as desired, DX9, DX10, OpenGL
class Renderer
{
public:
    
    // ========== LIFECYCLE ========== //
    /// \brief Destructor
    virtual ~Renderer(void);

    // ========== OVERLODED OPERATORS ========== //

    // ========== METHODS ========== //
    
    /// \brief abstract method to render a scene
    virtual void renderScene(Model::Scene* scene) = 0;
    
    /// \brief abstract method to render black image
    virtual void renderBlack() = 0;

    /// \brief switch to 3D (with perspective projection) rendering
    void render3D();

    /// \brief switch to 2D (with orthogonal projection) rendering
    void render2D();

    /// \brief adds a text to be rendered in next rendering call
    void addText(std::string text, int pos_x, int pos_y);

    // ========== GETTERS ========== //

    // ========== SETTERS ========== //

    // ========== INQUIRY ========== //

protected:
    /// \brief struct to stores text to render data
    typedef struct 
    {
        std::string text;
        int pos_x;
        int pos_y;        
    }TextDataType;

    // ========== INTERNAL METHODS ========== //
    
    /// \brief Constructor
    Renderer(void);

    /// \brief clears all text data stored
    void clearText();

    // ========== ATTRIBUTES ========== //

    /// \brief collection of text to render
    std::vector<TextDataType*> text_to_render;

    /// \brief unitary cube object used for rendering
    RenderObject* cube_render_object;
    
    /// \brief unitary sphere object used for rendenring
    RenderObject* sphere_render_object;

    /// \brief 3D rendering set
    bool render_3D;

};
};
#endif // _SNAKE_RENDER_RENDERER_H__
